<template>
  <van-tabbar v-model="active">
    <van-tabbar-item v-for="(x,index) in navinfo" :key="index" @click="changetabs(index)" :icon="active==index?x.activeicon:x.icon">{{x.title}}</van-tabbar-item>
  </van-tabbar>
</template>
<script>
export default {
  data() {
    return {
      active: 0,
    }
  },
  props:['navinfo'],
  methods:{
    onClickLeft() {
      this.$toast('返回');
    },
    onClickRight() {
      this.$toast('按钮');
    },
    changetabs(index){
      this.navinfo.index=index;
      this.$emit('changeComponent',index);
    }
  },
  beforeCreate: function() {
  },
  created: function() {
  },
  beforeMount: function() {
  },
  mounted: function() {
  },
  beforeUpdate: function() {
  },
  updated: function() {
  },
  activated: function() {
  },
  deactivated: function() {
  },
  beforeDestroy: function() {
  },
  destroyed: function() {
  },
  errorCaptured: function(err, vm, info) {
  }
}
</script>
<style scoped>
</style>
